#! /usr/bin/python

def mod_exp(b, e, m):
    org = e
    alist = []
    result = 1
    while(e > 0):
	if e&1 == 1: 
	   result = (result * b)%m
	e = e>>1
	b = b**2%m
    return result

e = 1777
for k in range(1855):
    e = mod_exp(1777, e, 10**8)
    print e

print e
